﻿using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;

namespace OccupierArchiver.Helpers
{
    internal class DataExporter
    {
        private readonly DataTable _dataTable;

        public DataExporter(DataTable dataTable)
        {
            _dataTable = dataTable;
        }

        public void ExportToSql(string path)
        {
            var exporter = new SqlScriptExporter(_dataTable);
            using (var stream = new StreamWriter("output.sql", false, Encoding.GetEncoding("utf-8")))
            {
                exporter.BuildExportScript(stream);
            }
        }
    }
}
